﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Domain.Entities;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var db = new MyHealthContext2())
            {
                // Create and save a new Blog 
                Console.Write("Enter a hello: ");
                var hello = Console.ReadLine();

                var example = new Example { Hello = hello };
                db.Examples.Add(example);
                db.SaveChanges();

                // Display all Examples from the database 
                var query = from e in db.Examples
                            orderby e.Hello
                            select e;

                Console.WriteLine("All blogs in the database:");
                foreach (var exmpl in query)
                {
                    Console.WriteLine(exmpl.Hello);
                }

                Console.WriteLine("Press any key to exit...");
                Console.ReadKey();
            }
        }

        public class MyHealthContext2 : DbContext
        {
            public DbSet<Bill> Bills { get; set; }
            public DbSet<BillStatus> BillStatus { get; set; }
            public DbSet<Example> Examples { get; set; }
            public DbSet<HealthCareEntity> HealthCareEntities { get; set; }
            public DbSet<HealthCareEntityType> HealthCareEntityTypes { get; set; }
            public DbSet<OrderLine> OrderLines { get; set; }
            public DbSet<MhUser> Users { get; set; }

        }

    }
}
